//
//  WNTool.h
//  Whatnet_iOS
//
//  Created by Bill on 2019/5/3.
//  Copyright © 2019 什么网络. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MBProgressHUD.h"
NS_ASSUME_NONNULL_BEGIN

typedef void(^WNClickNoDataView)(void);//点击了无数据按钮

@interface WNTool : NSObject
@property (nonatomic, strong) MBProgressHUD *hud;
+ (id)shared;
+ (id)showLoading;
+ (BOOL)hideLoading;
+ (id)showLoadingView:(UIView *)view;
+ (BOOL)hideLoadingView:(UIView *)view;
+ (id)showLoadingMessage:(NSString *)message;
+ (MBProgressHUD *)showLoadingMessage:(NSString *)message view:(UIView *)view;

//视频合成进度显示  需调用下面两个接口
+ (void)showVieoProgressWithMessage:(NSString *)message;//首先调用这个

+ (id)show:(NSString *)string;
// 网络信息提示
+ (id)showWithCode:(NSInteger )code;
+ (id)show:(NSString *)string inView:(UIView *)view;

+ (MBProgressHUD *)showProgress:(NSString *)string inView:(UIView *)view;

// 延时执行
+ (void)delay:(double_t)seconds withBlock:(dispatch_block_t)block;
// 渐变效果
+ (CATransition *)addFadeAnimationWithDuration:(CFTimeInterval)duration;
// 推送效果
+ (CATransition *)addPushAnimationWithDirection:(NSString*)direction;

+ (CATransition *)addAnimationType:(NSString *)type direction:(NSString *)direction;
+ (CATransition *)addAnimationType:(NSString *)type direction:(NSString *)direction duration:(CFTimeInterval)time;
// 相册权限
+ (NSString *)captureStatus;
+ (NSString *)deviceString;
+ (NSString *)deviceUDID;

+ (NSString *)getLaunchImageName;
// 应用标记

//获取当前显示的控制器
+ (UIViewController *)getCurrentVC;
//无数据的默认视图
+ (UIView *)noDataWithStr:(NSString *)str imageName:(NSString *)imageName height:(CGFloat)height block:(WNClickNoDataView)clickBlock;
//网络请求Code对应的提示
+ (NSString *)strWithCode:(NSInteger)code;
//转换一下错误提醒文字
+ (NSAttributedString *)requestErrorWithSting:(NSString *)string;
//评论排版
+ (NSAttributedString *)commentWithString:(NSString *)string;
//字体添加阴影
+ (NSAttributedString *)shadowWithString:(NSString *)string font:(UIFont *)font fontColor:(UIColor *)fontColor;

//字体添加阴影
+ (NSAttributedString *)shadowWithString:(NSString *)string//字符串
                                    font:(UIFont *)font//字体
                               fontColor:(UIColor *)fontColor//字体颜色
                             shadowColor:(UIColor *)shadowColor//阴影颜色
                            shadowOffset:(CGSize )shadowOffset;//阴影偏移量

//字体添加阴影
+ (NSAttributedString *)shadowWithString:(NSString *)string
                                    font:(UIFont *)font
                               fontColor:(UIColor *)fontColor
                             shadowColor:(UIColor *)shadowColor
                            shadowOffset:(CGSize )shadowOffset
                               alignment:(NSTextAlignment )alignment;

//获取当前版本号
+ (NSString *)currentAppVersion;

+ (NSInteger)compareVersion2:(NSString *)v1 to:(NSString *)v2;

//判断当前时间
+ (BOOL)judgeTime;

//判断黑名单类型
+ (BOOL)judgeBlackListTypeWith:(NSString *)black;

//获取当前显示控制器
+ (UIViewController *)topViewController;

- (void)playlocalmusic:(NSString *)name number:(NSInteger)number;

- (void)stopPlayMusic;

//将Model转为字典
+ (NSDictionary *)DictionaryFromModel:(id)model;


//图片转字符串
+(NSString *)UIImageToBase64Str:(UIImage *) image;

//字符串转图片
+(UIImage *)Base64StrToUIImage:(NSString *)_encodedImageStr;



@end

NS_ASSUME_NONNULL_END
